import wx

# 设置串口参数的对话框类

class UI_Help(wx.Dialog):

    def __init__(self, *args, **kwds):

        # 参数调入后初始化
        super(UI_Help, self).__init__(*args, **kwds)

        self.InitUI()
        self.SetSize((400, 400))
        self.SetTitle("使用帮助")

    def InitUI(self):

        self.panel = wx.Panel(self)
        self.vbox = wx.BoxSizer(wx.VERTICAL)

        self.sb = wx.StaticBox(self.panel, label='使用帮助')
        self.sbs = wx.StaticBoxSizer(self.sb, orient=wx.VERTICAL)

        self.hbox1 = wx.BoxSizer(wx.HORIZONTAL)
        self.staticText1 = wx.StaticText(self.panel, label='上海奕枫仪器设备有限公司' )
        self.hbox1.Add(self.staticText1)
        self.sbs.Add(self.hbox1)

        self.panel.SetSizer(self.sbs)

        self.hbox_0 = wx.BoxSizer(wx.HORIZONTAL)
        self.okButton = wx.Button(self, label=u'确认')
        self.closeButton = wx.Button(self, label='关闭')
        self.hbox_0.Add(self.okButton)
        self.hbox_0.Add(self.closeButton, flag=wx.LEFT, border=5)

        self.vbox.Add(self.panel, proportion=1,
                flag=wx.ALL | wx.EXPAND, border=5)
        self.vbox.Add(self.hbox_0, flag=wx.ALIGN_CENTER | wx.TOP | wx.BOTTOM, border=10)

        self.SetSizer(self.vbox)

        self.okButton.Bind(wx.EVT_BUTTON, self.OnSave)
        self.closeButton.Bind(wx.EVT_BUTTON, self.OnClose)
 

    def saveData(self, e):
        pass   

    def OnClose(self, e):
        self.Destroy()

    def OnSave(self, e):
        self.EndModal(wx.ID_OK)




